/*

Author   : chaos

FileName : comp_value.cpp

Date     : 15/08/17 02:44:21

*/
#include <iostream>
using namespace std;

class Base
{
    public:
        Base()
        {cout << "Basse's constructor is called!" << endl;}
};

class Composition_1
{
    public:
        Composition_1()
        { cout << "Composition_1's constructor is called!" << endl; }
        void show()
        {cout << "Composition_1::show is called !" << endl;}
};

class Composition_2
{
    public:
        Composition_2(int i)
        { cout << "Composition_2's constructor is called !" << endl; }
};

class Derived:public Base
{
    public:
        Composition_2 com_2;
        Composition_1 com_1;

        Derived():com_2(1)
    {cout << "Derived's constructor is called !" << endl;}
};


int main(int argc ,char *argv[])
{
    Derived derived_object;

    derived_object.com_1.show();

    return 0;
}
